cc.Class({
    extends: require('BaseUI'),

    properties: {
        nodeBg: cc.Node,
    },

    onLoad() {
        this._super();

        // 拉伸背景
        const canvas = G.game.getComponent(cc.Canvas);
        let designScale = canvas.designResolution.width / canvas.designResolution.height;
        if (designScale <= cc.view.getCanvasSize().width / cc.view.getCanvasSize().height) {
            if (!this.nodeBg) {
                return;
            }
            let scale = canvas.designResolution.height / cc.view.getCanvasSize().height;
            this.nodeBg.width = scale * cc.view.getCanvasSize().width;
            this.nodeBg.height = this.nodeBg.width / designScale;
        } else {
            if (!this.nodeBg) {
                return;
            }
            let scale = canvas.designResolution.width / cc.view.getCanvasSize().width;
            this.nodeBg.height = scale * cc.view.getCanvasSize().height;
            this.nodeBg.width = this.nodeBg.height * designScale;
        }
    },

    start() {

    },
    // update (dt) {},
});
